<?php if(is_weixin()){?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
//请求关注提醒信息
$.post('<?php echo U('Home/Ajax/getJsSdk');?>',{url:window.location.href},function(data){
	//$(document).find('body').append(data);
	//alert(data.signature);
	//alert(data.rawString);
	wx.config({
		//debug: true,
		appId: data.appId,
		timestamp: data.timestamp,
		nonceStr: data.nonceStr,
		signature: data.signature,
		jsApiList: [
		  // 所有要调用的 API 都要加到这个列表中
		  
		  'onMenuShareTimeline',
		  'onMenuShareAppMessage',
		 
		]
	});
	wx.ready(function () {
	  var shareData = {
		title: '<?php echo getPageTitle($seo['title']);?>',
		desc: '<?php echo getPageDescription($seo['description']);?>',
		link: '<?php echo U('', array('aff_id' => $_SESSION['memberInfo']['id']), true, false, true);?>',
		imgUrl: '<?php echo getPageLogo($img_url);?>',
		success: function () { 
        // 用户确认分享后执行的回调函数
		    $.post('<?php echo U('Home/Ajax/weixinshare');?>',{url:'<?php echo U('', array('aff_id' => $_SESSION['memberInfo']['id']), true, false, true);?>'}, function(){
				//success('分享成功！');
			});
        }
	  };
	  wx.onMenuShareAppMessage(shareData);
	  wx.onMenuShareTimeline(shareData);
	});
},'json');</script> 
<?php }?>
<?php if(!IS_AJAX){?></div>


<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/validform/style.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/validform/css/jqtransform.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/js/artDialog/skins/blue.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/dialog.reset.css">

<<script src="__PUBLIC__/Admin/js/artDialog/artDialog.source.js"></script>
<script src="__PUBLIC__/Admin/js/artDialog/plugins/iframeTools.js"></script>
<script src="__PUBLIC__/Js/validform/Validform.js"></script>
<script src="__PUBLIC__/Js/validform/jquery.jqtransform-min.js"></script>


<script src="__PUBLIC__/Intesys/AdminX/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/ios-switch/switchery.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/iCheck/jquery.icheck.js"></script>
<script src="__PUBLIC__/Js/jquery-ajaxlist-single.js"></script>

<?php echo getSysVal('script');?>

<!-- Ajax用户登录 -->
<script>
$.holdReady(true);

var artdialog = art.dialog;

$(window).resize(function(){
    $('.main-code').Elementflex();
});


$(document).ready(function(e) {
	//动画
	/*animatecss.initanimateall();*/
	$('.main-code').Elementflex();
	$(window).scroll(function() {
		if($('.container').eq(0).css('display') == 'none'){return;}
		$('#scroll_hidden').val($(document).scrollTop());
		$.cookie('scroll_hidden', $(document).scrollTop());
		if($(document).scrollTop() > 300){
			$('#goTop').show();
		}else{
			$('#goTop').hide();
		}
		$.cookie('scroll_url_hidden', window.location.href);
		
    });
	if(window.history.length > 0){
		if($.cookie('scroll_url_hidden') == window.location.href){
			$("html,body").animate({scrollTop:$.cookie('scroll_hidden')},100);
		}
	}
	
	
	
	
	//页面停留
	$('a').each(function(index, element) {
        if(window.location.href.indexOf($(this).attr('href')) >= 0 && $(this).attr('href') != '/'){
			$(this).addClass('navon');
		}
    });
	
	$('.navbar-nav a').click(function(e) {
		if($(this).attr('target')=='_blank'){
		window.open($(this).attr('href'));
		return false;	
		}
        window.location.href = $(this).attr('href');
    });
	
	
	$('.artdialogA').each(function(index, element) {
        $(this).click(function(e) {
            artdialog.open($(element).attr('href'), {width: $(element).attr('w')*1, height: $(element).attr('h')*1,lock:true,title:$(element).attr('title')});
			return false;
        });
    });
	
	
	
	$('.showImg').each(function(index, element) {
        $(this).mouseenter(function(e) {
            var src = $(this).attr('imgUrl');
			var width = $(this).attr('imgWidth');
			var height = $(this).attr('imgHeight');
			//加入图片，设置位置
			$(body).append('<img src="'+src+'" width="'+width+'" height="'+height+'" style="">');
        });
    });
	
	
    $(".guestbookdataform").each(function(index, element) {
        $(this).Validform({
			ajaxPost:true,
			tiptype:function(data,s){
				if(s.type == 3){
					//error(data);
				}
			},
			callback:function(data){
				if(data.status == 0){
					//error(data.info);
					if(data.needLogin == 1){
						artdialog.data('needlogin',artdialog);
						artdialog.data('submitForm',element);
						artdialog.open('<?php echo U('Ajax/login');?>', {width: 320, height: 320,lock:true,title:'用户登录'});
					}
				}else if(data.status == 1){
					ClearForm(element);
					success(data.info);
					try{
						submitSuccess();
					}catch (e){

					}
				}else{
					error(data.info);
				}
			},
			usePlugin:{
				jqtransform:{
					//会在当前表单下查找这些元素;
					selector:"select,:checkbox,:radio,:text,:submit"
				}
			}

	    });
    });
});

function ClearForm(e) {
    var objId = e;
    if (objId == undefined) {
        return;
    }
    for (var i = 0; i < objId.elements.length; i++) {
        if (objId.elements[i].type == "text") {
            objId.elements[i].value = "";
        }
        else if (objId.elements[i].type == "password") {
            objId.elements[i].value = "";
        }
        else if (objId.elements[i].type == "radio") {
            objId.elements[i].checked = false;
        }
        else if (objId.elements[i].type == "checkbox") {
            objId.elements[i].checked = false;
        }
        else if (objId.elements[i].type == "select-one") {
            objId.elements[i].options[0].selected = true;
        }
        else if (objId.elements[i].type == "select-multiple") {
            for (var j = 0; j < objId.elements[i].options.length; j++) {
                objId.elements[i].options[j].selected = false;
            }
        }
        else if (objId.elements[i].type == "textarea") {
            objId.elements[i].value = "";
        }

    }
}
function error(msg){
		var d = artDialog({
			title: '操作错误',
			content: msg,
			cancel: false,
			ok: function () {
				
				}
		});
		d.show();
	}
function success(msg){
		var d = artDialog({
			title: '操作成功',
			content: msg,
			cancel: false,
			ok: function () {
				
				}
		});
		d.show();
	}


//请求关注提醒信息
$.get('<?php echo U('Home/Ajax/subscribe');?>',{},function(data){
	$(document).find('body').before(data);
},'html');








function showshareBox(){
	document.getElementById('shareBox_').style.display = 'block';
}
function showCartBox_layout(){
	document.getElementById('CartBox_layout').style.display = 'block';
	$('#CartBox_').animate({'bottom':'0px'},100);
}
function hideCartBox_layout(){
	document.getElementById('CartBox_layout').style.display = 'none';
	$('#CartBox_').animate({'bottom':'-1000px'},100);
	
}

function addCartList(id){
	$.post('<?php echo U('Home/Ajax/getCartView');?>',{id:id}, function(data){
		$('#CartBox_b').remove();
		if($('#CartBox_').length > 0){
			$('#CartBox_').replaceWith(data);
		}else{
			$(document).find('body').after(data);
		}
		
	},'html');
}










</script>



 
<div onClick="hideCartBox_layout();" id="CartBox_layout" style="position:fixed; top:0; left:0; z-index:999; width:100%; height:10000px; background:rgba(0,0,0,0.5); display:none;"></div>



<div id="shareBox_" onclick="this.style.display='none';" style="width: 100%; display: block; height: 30000px; position: fixed; left: 0px; top: 0px; z-index: 80000; text-align: right; background: rgba(0, 0, 0, 0.4); display:none;">
   <img src="/Public/guide.png" width="50%"><br>
  
   <p style="font-size:18px; text-align:center; color:#fff; font-weight:bold;"><span style="padding:5px 12px; border:2px solid #fff;">我知道了</span></p><br>
</div>

<input type="hidden" id="scroll_hidden" value="0">

<?php if($_SESSION[C('USER_AUTH_KEY') ] && $_SESSION['siteid'] == __SITEID__){?>






<link rel="stylesheet" type="text/css" href="/Public/Js/ferroMenu/demos.css">
<link rel="stylesheet" type="text/css" href="/Public/Js/ferroMenu/jquery.ferro.ferroMenu.css">
<script src="/Public/Js/ferroMenu/jquery.ferro.ferroMenu-1.2.3.min.js"></script>
<script src="/Public/Js/ferroMenu/jquery.transit.min.js"></script>
<style>
    .ferromenu-controller{z-index:1031 !important;}
	#nav a.on{color:#ED484B;}
</style>
<ul id="nav">

<if condition="!isMobile()">
    <li><a class="" href="javascript:void(0);" onclick="_bindSearch(this);"><i class="fa fa-search"></i></a></li>
    
    
    <else/>
    <li><a class="" href="javascript:void(0);" onClick="window.location.reload();"><i class="fa fa-refresh"></i></a></li>
   </if> 
   
    
    
    <li><a class="" href="javascript:void(0);" onClick="_bindEditText(this);"><i class="fa fa-edit"></i></a></li>
    <li><a class="" href="javascript:void(0);" onClick="_bindrightbtn(this);"><i class="fa fa-hand-o-up"></i></a></li>
    <li><a href="javascript:void(0);" onClick="window.location.href='/Admin?siteid=<?php echo __SITEID__;?>';"><i class="fa fa-laptop"></i></a></li>
</ul>
    <script>$()
	
	    $("#nav").ferroMenu({
			position 	: "left-bottom",
			delay 		: 0,
			rotation 	: 0,
			margin		: 20,
			opened		: false, 
			openTime    : 100,
			closeTime   : 100,
			drag        : true,
			radius      : 100
		});
		//$("#nav").ferroMenu().toggleMenu(); 
	</script> 
<?php }?>


<a href="javascirpt:void(0);" onClick="goTop();" id="goTop" style="position:fixed; display:none; z-index:1000; bottom:60px; right:5px;"><i style="width:40px; border-radius:50px; font-size:40px; height:40px; line-height:40px; text-align:center; background:rgba(0,0,0,0.41); color:#D0D0D0;" class="fa fa-arrow-circle-o-up"></i></a>
<script>
    function goTop(){
		$('html,body').animate({scrollTop:0},100);
	}
</script>
</body>
</html>




<?php if($_SESSION[C('USER_AUTH_KEY') ] && $_SESSION['siteid'] == __SITEID__){?>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/ichsmart/jquery-ichsmart.css"/>
<if condition="!isMobile()">
<script type="text/javascript" src="__PUBLIC__/Js/ichsmart/jquery.ichsmart.js"></script>
<else/>
<script type="text/javascript" src="__PUBLIC__/Js/ichsmart/jquery.ichsmart.m.js"></script>
</if>
<script>



function _bindSearch(e){
	if($(e).attr('class').toString().indexOf('on') < 0){
		bindSearch();
		$(e).addClass('on');
	}else{
		//解除
		$('.viewBox *').unbind('mouseenter');
		$(e).removeClass('on');
	}
	$().ferroMenu.toggleMenu('#nav');

	
}


function _bindEditText(e){
	if($(e).attr('class').toString().indexOf('on') < 0){
		bindEditText();
		$(e).addClass('on');
	}else{
		//解除
		$('.editText').unbind('mouseenter');
		$(e).removeClass('on');
	}
	$().ferroMenu.toggleMenu('#nav');
}

function _bindrightbtn(e){
	if($(e).attr('class').toString().indexOf('on') < 0){
		$('.viewBox').each(function(index, element){
			bindrightbtn(element);
		});
		$(e).addClass('on');
	}else{
		//解除
		$('.viewBox').unbind('click');
		$(e).removeClass('on');
	}
	$().ferroMenu.toggleMenu('#nav');
}

    var mydialog = art.dialog;
    
    $(document).ready(function(e) {
		//bindSearch();
        
    });
    function bindrightbtn(element){
		var width = $(window).width();
		/*if(width > 1200){
		    width = 1200;
		}*/
		$(element).smartedit({
			title: $(element).attr('title'),
			isEdit:$(element).attr('isEdit'),
			close:null,
			setting: function() {
				
				$('#rightmenu_').remove();
				$('body .container:eq(0)').hide();
				mydialog.open($(element).attr('settingUrl').replace('/<?php echo __SITEID__;?>/','/'), {init:function(){
			$('.aui_state_focus').addClass('auii_statei_focus');
			var index = $(".auii_statei_focus").length;
			index ++;
			
			$(".aui_state_focus").attr("index", index);
			$(".aui_state_focus").attr('rel', url);
			$('.aui_state_focus').addClass('index'+index);
			
			  
		},width: width, height: $(window).height()-95,lock:true,title:'编辑',close: function () {
			$('body .container:eq(0)').show();
                
            }});
				return;
			},
			edit: function() {
				
				$('#rightmenu_').remove();
				$('#settingModal').on('show.bs.modal',
				function() {
					if($(element).attr('editUrl').indexOf('/<?php echo __SITEID__;?>/') == 0){
						var editUrl = $(element).attr('editUrl').replace('/<?php echo __SITEID__;?>/','/');
					}else{
						var editUrl = $(element).attr('editUrl');
					}
					$('#settingBox').attr('src', editUrl);
					$('#settingBoxid').val($(element).attr('modulesID'));
				});
				
				$('#settingModal').modal('show');
				$('#settingModal .modal-content').height($(window).height());
				$('#settingModal .modal-body').height($(window).height() - 36);

			},
		sortup:null,
		sortdown:null,
		copy:null,
		paste:null,
        copystyle:null
		});
	}
	
	
	
	
	function submitSuccess(status, info, data) {
		
        updateModules(data);

    }
	
	

	
	
    //更新模块
    function updateModules(id) {
		$('#pro_rate').show();
        $.get('{:U('')}', {
            modulesID:id
        },
        function(data) {
            if (data.status == 1) {
				
				
				//一级元素
				$(".myBox" + id).prev("style").remove();
				
                $(".myBox" + id).replaceWith(data.data);
				$('.viewBox').each(function(index, element){
					bindrightbtn(element);
				});
				
				
				
				$('.myBox' + id +' .main-code').Elementflex();
				
				/*$(".myBox" + id).each(function(index, element) {
					//bindrightbtn(element);
				});
				$(".myBox" + id).find('.viewBox').each(function(index, element) {
					//bindrightbtn(element);
				});*/
				bindEditText();
            }
        },
        'json');
		
		
		$.post('<?php echo U('Admin/Index/clearCache');?>'.replace('/<?php echo __SITEID__;?>/','/'),{},function(data){});
		$("html,body").animate({scrollTop:$.cookie('scroll_hidden')},100);
    }
	
	
	
	
	
	
	
	$(document).ready(function(e) {
        //bindEditText();
		//模态框出现时把这个框插入到容器外部
		$('#settingModal').appendTo('body');
		$('#settingModal').wrap('<div class="container"></div>');
		
		$('#settingModal').on('show.bs.modal',
		  function() {
			  $('.container').eq(0).hide();
		  });
		  $('#settingModal').on('hide.bs.modal',
		  function() {
			  $('.container').eq(0).show();
			  $("html,body").animate({scrollTop:$("#scroll_hidden").val()},100);
		  });
		
		
		$('#EditTextBox').mouseleave(function(e) {
            $(this).hide();
        });
		
		$('#SearchBox').mouseleave(function(e) {
            $(this).hide();
        });
		
    });
	
	function bindEditText(){
		<if condition="!isMobile()">
		$('#EditTextBox').rightClick(function(e){
			$('#EditTextBox').hide();
		});
		$('#EditTextBox_').rightClick(function(e){
			$('#EditTextBox_').hide();
		});</if>
		$('.viewBox').each(function(viewBoxindex, viewBoxelement) {
			
			if($(viewBoxelement).find('.viewBox').length == 0){
			
		// 自定义模块编辑
		$(viewBoxelement).find('.editText').each(function(index, element) {
			$(this).mouseenter(function(e) {
				var height = $(this).outerHeight();
				var width = $(this).outerWidth();
				var top = $(this).offset().top;
				var left = $(this).offset().left;
				$('#EditTextBox').css({'top':top+'px', 'left':left+'px', 'line-height':height+'px'});
				$('#EditTextBox').width(width-2);
				$('#EditTextBox').height(height-2);
				$('#EditTextBox').show();
				//var className = '.'+$(this).attr('class').replaceAll(' ','.');
				$('#EditTextBox').attr('name', $(this).attr('name'));
				$('#EditTextBox').attr('title', $(viewBoxelement).attr('title'));
				$('#EditTextBox').attr('modulesID', $(viewBoxelement).attr('modulesID'));
				$('#EditTextBox').attr('datatype', $(this).attr('datatype'));
				
				$('#EditTextBox').show();
			});
		});
		
		// 布局模块编辑
		$(viewBoxelement).find('.wrap-box').each(function(index, element) {
			$(this).mouseenter(function(e) {
				var height = $(this).outerHeight();
				var width = $(this).outerWidth();
				var top = $(this).offset().top;
				var left = $(this).offset().left;
				$('#EditTextBox_').css({'top':top+'px', 'left':left+'px', 'line-height':height+'px'});
				$('#EditTextBox_').width(width-2);
				$('#EditTextBox_').height(height-2);
				$('#EditTextBox_').show();
				$('#EditTextBox_').attr('index', index);
				//数据类型
				if($(this).find('img').length == 1){
					$('#EditTextBox_').attr('datatype', 'image');
				}else{
					$('#EditTextBox_').attr('datatype', 'text');
				}
				$('#EditTextBox_').attr('title', $(viewBoxelement).attr('title'));
				$('#EditTextBox_').attr('modulesID', $(viewBoxelement).attr('modulesID'));
			});
		});
		
		
		
		
			}
		
	});
	}
	
	
	//关闭设置框
	function closeModel(){
		$('#settingModal').modal('hide');
		updateModules(document.getElementById('settingBoxid').value);
	}
	
	
	function bindSearch(){
		$('#SearchBox').rightClick(function(e){
			$('#SearchBox').hide();
		});
		$('.viewBox').each(function(viewBoxindex, viewBoxelement){
			//最接近元素的盒子才绑定事件
			if($(viewBoxelement).find('.viewBox').length == 0){
				$(viewBoxelement).find('*').each(function(index, element) {
                if(typeof($(element).attr('class')) != 'undefined' && $(element).attr('class') != ''){
					$(this).mouseenter(function(e) {
						var height = $(this).outerHeight();
						var width = $(this).outerWidth();
						var top = $(this).offset().top;
						var left = $(this).offset().left;
						$('#SearchBox').css({'top':top+'px', 'left':left+'px'});
						$('#SearchBox').width(width-2);
						$('#SearchBox').height(height-2);
						$('#SearchBox').show();
						//绑定事件，准备编辑
						//alert($(this).attr('class'));
						var className = '.'+$(this).attr('class').replaceAll(' ','.');
						if(className.search(/\.myBox[0-9]+/) >= 0){
							className = '';
						}
						$('#SearchBox').attr('cssPath', className);
						$('#SearchBox').attr('title', $(viewBoxelement).attr('title'));
						$('#SearchBox').attr('modulesID', $(viewBoxelement).attr('modulesID'));
						stopPropagation(e);
					});
				}
            });
			}
            
        });
	}
	
	String.prototype.replaceAll = function(s1,s2){
　　return this.replace(new RegExp(s1,"gm"),s2);
　　}
	function stopPropagation(e) {  
		e = e || window.event;  
		if(e.stopPropagation) { //W3C阻止冒泡方法  
			e.stopPropagation();
		} else {  
			e.cancelBubble = true; //IE阻止冒泡方法  
		}  
	}  
	
	function getviewBoxelement(e){
		if($(e).attr('class').search(/\.myBox[0-9]+/) >= 0){alert('xxx');return e;}
		return $(e).parents('.viewBox').eq(0);
	}
	
	 
	function showCssEditBox(){
		
        $('#SearchBox').hide();
		$('.viewBox').find('*').unbind('mouseenter');
		art.dialog.data('cssElement',$($('#SearchBox').attr('cssPath')));
		var csspath = $('#SearchBox').attr('cssPath') == ''?'.myBox{id}' : '.myBox{id} '+$('#SearchBox').attr('cssPath');
		mydialog.open('<?php echo U('Admin/Pages/cssedit');?>?cssPath='.replace('/<?php echo __SITEID__;?>/','/')+csspath+'&modules_id='+$('#SearchBox').attr('modulesID'), {init:function(){
			$('.aui_state_focus').addClass('auii_statei_focus');
			var index = $(".auii_statei_focus").length;
			index ++;
			
			$(".aui_state_focus").attr("index", index);
			$(".aui_state_focus").attr('rel', url);
			$('.aui_state_focus').addClass('index'+index);
			
			
		},width: '305px', height: '450px',title:$('#SearchBox').attr('title')+'-编辑样式',lock: false,
		close: function () {
                bindSearch();
            },ok:function(){
			var d = this.iframe.contentWindow.document;
			var css = $(d).find('#target').attr('style');
			var cssPath_value = $(d).find('#cssPath_value').val();
			$.post(
			'<?php echo U('Admin/Modules/saveCss');?>'.replace('/<?php echo __SITEID__;?>/','/'),
			{'media':$(d).find('#media_value').val(),'css':css, 'modules_id':$('#SearchBox').attr('modulesID'),'csspath':'.myBox{id}'+cssPath_value.replace('.myBox{id}','')},
			function(data){
				updateModules($('#SearchBox').attr('modulesID'));
			},'json');
		}});
	}
	
	//编辑单个自定义字段
	function showEditTextBox(){
        $('#EditTextBox').hide();
		$('.viewBox *').unbind('mouseenter');
		var width = $(window).width();
		if(width > 400){
		    width = 400;
		}
		$('body .container:eq(0)').hide();
		mydialog.open('<?php echo U('Admin/Modules/editText');?>'.replace('/<?php echo __SITEID__;?>/','/')+'?datatype='+$('#EditTextBox').attr('datatype')+'&name='+$('#EditTextBox').attr('name')+'&modules_id='+$('#EditTextBox').attr('modulesID'), {init:function(){
			$('.aui_state_focus').addClass('auii_statei_focus');
			var index = $(".auii_statei_focus").length;
			index ++;
			
			$(".aui_state_focus").attr("index", index);
			$(".aui_state_focus").attr('rel', url);
			$('.aui_state_focus').addClass('index'+index);
			
			
		},width: width+'px', height: $(window).height()-95,title:$('#EditTextBox').attr('title')+'-编辑',lock: false,ok:function(){
			var d = this.iframe.contentWindow.document;
			var textValue = $(d).find('#textValue').val();
			$.post(
			'<?php echo U('Admin/Modules/saveText');?>'.replace('/<?php echo __SITEID__;?>/','/'),
			{'name':$(d).find('#name').val(),'value':$(d).find('#value').val(), 'id':$(d).find('#id').val(), 'link':$(d).find('#link').val()},
			function(data){
				updateModules($('#EditTextBox').attr('modulesID'));
				
			},'json');
		},close: function () {
			$('body .container:eq(0)').show();
                bindEditText();
            }});
	}
	
	
	//编辑单个布局模块元素
	function showEditTextBox_(){
        $('#EditTextBox_').hide();
		$('.viewBox *').unbind('mouseenter');
		var width = $(window).width();
		if(width > 400){
		    width = 400;
		}
		$('body .container:eq(0)').hide();
		mydialog.open('<?php echo U('Admin/Modules/editModelText');?>'.replace('/<?php echo __SITEID__;?>/','/')+'?index='+$('#EditTextBox_').attr('index')+'&datatype='+$('#EditTextBox_').attr('datatype')+'&modules_id='+$('#EditTextBox_').attr('modulesID'), {init:function(){
			$('.aui_state_focus').addClass('auii_statei_focus');
			var index = $(".auii_statei_focus").length;
			index ++;
			
			$(".aui_state_focus").attr("index", index);
			$(".aui_state_focus").attr('rel', url);
			$('.aui_state_focus').addClass('index'+index);
			
			
		},width: width+'px', height: $(window).height()-95,title:$('#EditTextBox_').attr('title')+'-编辑',lock: false,ok:function(){
			var d = this.iframe.contentWindow.document;
			
			
			$(d).find('#editcode .wrap-box').eq($('#EditTextBox_').attr('index')).find('a').attr('href',$(d).find('#link').val());
			$(d).find('#editcode .wrap-box').eq($('#EditTextBox_').attr('index')).find('img').attr('src',$(d).find('#img_url').attr('src'));
			if($('#EditTextBox_').attr('datatype') == 'text'){
				this.iframe.contentWindow.getContent();
				
			}
			var textValue = $(d).find('#editcode').html();
			$.post(
			'<?php echo U('Admin/Modules/saveModelText');?>'.replace('/<?php echo __SITEID__;?>/','/'),
			{'value':$(d).find('#editcode').html(), 'id':$(d).find('#id').val()},
			function(data){
				updateModules($('#EditTextBox_').attr('modulesID'));
				
			},'json');
		},close: function () {
			    $('body .container:eq(0)').show();
                bindEditText();
            }});
	}
</script>



<div class="modal fade" id="settingModal" tabindex="-1" role="dialog" aria-labelledby="shareModalLabel" aria-hidden="true">
  <div class="modal-dialog" style="margin:0; width:100%;"> 
    <div class="modal-content" style="border:none; width:100%;">
      <div class="modal-header">
      <input type="hidden" id="settingBoxid" value="">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" onClick="updateModules(document.getElementById('settingBoxid').value);">&times;</button>
        <h4 class="modal-title">编辑内容</h4>
      </div>
      <div class="modal-body" style="padding-top:0px; padding:0;">
        <iframe src="" class="embed-responsive-item" id="settingBox" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
      </div>
    </div>
  </div>
</div>

<!-- 查找元素时用的高亮层 -->
 <div id="SearchBox" cssPath="" modulesID="" onClick="showCssEditBox();" style="border:1px dashed #ccc;background-color:rgba(0,0,0,0.6); display:none; position:absolute; z-index:8000000;"></div>
<!-- 查找元素时用的高亮层end -->
<!-- 查找元素时用的高亮层 -->
 <div id="EditTextBox" datatype="" name="" modulesID="" onclick="showEditTextBox();" style="position: absolute; display:none; z-index: 8000000; background-color: rgba(0, 0, 0, 0.6); border:1px dashed #ccc; color:#fff; text-align:center; line-height:1;">点击修改</div>
<!-- 查找元素时用的高亮层end -->

<!-- 查找元素时用的高亮层 -->
 <div id="EditTextBox_" index="" datatype="" modulesID="" onclick="showEditTextBox_();" style="position: absolute; display:none; z-index: 8000000; background-color: rgba(0, 0, 0, 0.6); border:1px dashed #ccc; color:#fff; text-align:center; line-height:1;">点击修改</div>
<!-- 查找元素时用的高亮层end -->


<?php }?>




<?php }?>